
var payCenterInit = function(){};
payCenterInit.prototype = {
  
  initOrderInfor:function(user, orders){
    var order = orders[0];
    var html = [];
    var isChargeOrder = false;
    var items = order.items;
    var totalPayfee = 0;
    var totalttl_coin = 0;
    var totaldelivery_fee = 0;
    var i = 0;
		html.push('<div class="zcchengg">');
		html.push('<div class="zhifu-k">');
		html.push('<p id="showOrderDetail" class="zhifu-biaoti"><span>订单详情<b><img src="../../images/top2.png"/></b></span>'+ order.status_text +'</p>');
		html.push('<div class="overflow">');		
		html.push('<p class="zhifu-ny">请您在提交订单后24小时内完成支付，否则订单会自动取消。</p>');
		html.push('<p class="zhifu-ny">剩余时间：23:10:05</p>');
		html.push('</div>');	
		if(!items || items.length == 0){
			isChargeOrder = true;
		}
		while (items[i]){
			if(items[i].good_kind == 2){
				isChargeOrder = true;
				break;
			}
			i++;
		}
		//充值订单不显示收件人信息
		if(!isChargeOrder){
			html.push('<div class="overflow">');
			html.push('<p class="zfcg-bt1 zfcg-bt2"><span>'+ (order.mobile||'') +'</span>收件人：'+ (order.consignee||'') +'</p>');
			html.push('<p class="zfcg-bt1">'+ (order.region_name||'') + ' ' + (order.address||'') +'</p>');
			html.push('</div>');
		}
		html.push('</div>');
		html.push('</div>');
		html.push('<div class="zfcg-dizhi mbtopbottom">');
		html.push('<div class="zfcg-sfjek">');
		html.push('<p class="zfcg-sfje">');
		html.push('<i class="yfjine">应付金额：</i>');
		i = 0;
		while (orders[i]){
			totalPayfee += orders[i].pay_fee;
			totalttl_coin += orders[i].ttl_coin;
			totaldelivery_fee += orders[i].delivery_fee;
			i++;
		}
		html.push('<span class="money hongse">&yen;<span id="pay_fee">'+ (totalPayfee) +'</span></span>');
		if(!isChargeOrder){
			html.push('+');
			html.push('<span class="jinbi"><b><img src="../../images/jbtub.jpg"></b><b id="ttl_coin">'+ (totalttl_coin) +'</b></span>');
		}
		html.push('</p>');
		html.push('<p class="zfcg-hyf">含运费: <b id="delivery_fee">'+ (totaldelivery_fee) +'</b></p>');
		html.push('</div>');
		html.push('</div>');
		
		if(!isChargeOrder){
			html.push('<div class="zhifu">');
			html.push('<p class="zhifu-yezf">余额支付</p>');		
			html.push('<div class="wlxqnrbg mbtopbottom">');
			html.push('<p class="wlxqnr mbbottom">');
			html.push('<span style="margin-right:15px;" class="zhifu-qb">');
			html.push('<b class="zhifu-qianbao">');
			html.push('<input type="checkbox" id="checkbox-1-1_wallet" /><label for="checkbox-1-1_wallet"></label>');
			html.push('</b>');
			html.push('<b class="ybzt">账户可用余额<b id="money">'+ user.money +'</b>元</b>');
			html.push('</span> 钱包支付');
			html.push('</p>');
			html.push('</div>');		
			html.push('<div id="payPassword" style="display:none;" class="wlxqnr positionr" style="top:5px;height:30px;">');
			html.push('<span class="payment-title">支付密码：</span>');
			html.push('<p class="payment-input" style="top:4px; height:30px;"><input placeholder="请输入密码" style="height:30px;line-height:20px!important;disblay:block; font-size:1.6rem;padding: 0px 5px;" id="password" type="password" class="mmwbk"/></p>');
			html.push('</div>');
			html.push('</div>');
		}
		
		html.push('<div class="zhifu mtop10">');
		html.push('<p class="zhifu-yezf">支付方式</p>');
		html.push('<div class="wlxqnrbg mbtopbottom">');
		//支付宝
		html.push('<p class="wlxqnr mbbottom">');
		html.push('<span class="checkbox-zcly">');
		html.push('<b class="checkboxFour" style="margin-top:13px;">');
		html.push('<input type="radio" value="alipay" id="alipay" name="paytype" class="checkbox-gx" />');
		html.push('<label for="alipay"></label>');
		html.push('</b>');
		html.push('</span>支付宝');
		html.push('<i class="zhifu-zfbtb"><img src="../../images/zfbtb.png"/></i>');
		html.push('</p>');
		//微信
		if(AGENT_CLIENT.APP){
			html.push('<p class="wlxqnr">');		
			html.push('<span class="checkbox-zcly">');
			html.push('<b class="checkboxFour" style="margin-top:13px;">');
			html.push('<input type="radio" value="wxpay" id="wxpay" name="paytype" class="checkbox-gx" />');
			html.push('<label for="wxpay"></label>');
			html.push('</b>');
			html.push('</span>微信支付');
			html.push('<i class="zhifu-zfbtb"><img src="../../images/zfbtb1.png"/></i>');
			html.push('</p>');
		}
		
		html.push('</div>');
		html.push('</div>');
    
    $("#main").html(html.join(''));
    $("#main").after('<div id="commitPay" class="footbg1 mbtopbottom"><p class="sjqyan">确认付款</p></div>');
  },
  
  
  
}